package com.hongmeng.teamwork.service.impl;

import com.hongmeng.teamwork.entity.po.TeamworkProject;
import com.hongmeng.teamwork.mapper.TeamworkProjectMapper;
import com.hongmeng.teamwork.service.ITeamworkProjectService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (TeamworkProject)表服务实现类
 *
 * @author makejava
 * @since 2023-11-15 16:46:06
 */
@Service("teamworkProjectService")
public class ITeamworkProjectServiceImpl implements ITeamworkProjectService {
    @Resource
    private TeamworkProjectMapper teamworkProjectMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public TeamworkProject queryById(Long id) {
        return this.teamworkProjectMapper.queryById(id);
    }

    @Override
    public List<TeamworkProject> queryByIdList(List<Long> idList) {
        return this.teamworkProjectMapper.queryByIdList(idList);
    }

    /**
     * 分页查询
     *
     * @param teamworkProject 筛选条件
     * @return 查询结果
     */
    @Override
    public List<TeamworkProject> queryByCondition(TeamworkProject teamworkProject) {
        return this.teamworkProjectMapper.queryByCondition(teamworkProject);
    }

    /**
     * 新增数据
     *
     * @param teamworkProject 实例对象
     * @return 实例对象
     */
    @Override
    public boolean insert(TeamworkProject teamworkProject) {
        return this.teamworkProjectMapper.insert(teamworkProject) > 0;
    }

    /**
     * 修改数据
     *
     * @param teamworkProject 实例对象
     * @return 实例对象
     */
    @Override
    public boolean update(TeamworkProject teamworkProject) {
        return this.teamworkProjectMapper.update(teamworkProject) > 0;
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.teamworkProjectMapper.deleteById(id) > 0;
    }
}
